import { ADD_PERSON } from "../constant";

const initState = [{id:'01', name: 'tome', age:18}]
export default function personReducer(preState = initState, action){
  const {type, data} = action 
  if(type === ADD_PERSON){ 
    return [data, ...preState]
  }

  return preState
}